package com.mobiletrain.org.motherkitch.utils;

import android.content.Context;

import com.lidroid.xutils.BitmapUtils;
import com.mobiletrain.org.motherkitch.R;


/**
 * Created by Administrator on 2015/4/10.
 */
public class ImageLoad {

    private static BitmapUtils bitmapUtils;

    public static BitmapUtils getBitmapUtils(Context context) {
        if (bitmapUtils != null) {
            return bitmapUtils;
        }
        bitmapUtils = new BitmapUtils(context,
                context.getExternalCacheDir().getPath(),
                0.35f,
                20 * 1024 * 1024);
        bitmapUtils.configDefaultLoadingImage(R.drawable.loading_img);
        bitmapUtils.configDefaultLoadFailedImage(R.drawable.loading_img);
        bitmapUtils.configMemoryCacheEnabled(true);
        bitmapUtils.configDiskCacheEnabled(true);
        bitmapUtils.configThreadPoolSize(4);
        return bitmapUtils;
    }
}
